<?php

namespace app\index\traits;

use app\common\model\Member;

/**
 * Trait SessionTrait
 * @package app\index\traits
 */
trait SessionTrait
{


    /**
     * 包装token到用户模型
     * @param Member $member
     * @return void
     */
    private function wrapToken(Member $member, $token): void
    {
        $member->token = $token;
        $member->imStr = base64_encode(json_encode(['id' => $member->id, 'token' => $token,]));
    }

}